import {Ajax} from '../utils/request';

const addAddress = (data) => Ajax.post("/api/address",data)

const getAllAddress = () => Ajax.get("/api/address")

const deleteAddress = (id)=> Ajax.delete("/api/address/" + id)

const getAddress = (id) => Ajax.get("/api/address/" + id)

const updateAddress = (id,data) => Ajax.put("/api/address/" + id,data)

const defaultAddress = (id) => Ajax.patch(`/api/address/${id}/default`)

export {
    addAddress,
    getAllAddress,
    deleteAddress,
    getAddress,
    updateAddress,
    defaultAddress
}